import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('../components/Login.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../components/Home.vue')
  },
  {
    path: '/header',
    name: 'Header',
    component: () => import('../components/Header.vue')
  },
  {
    path: '/',
    name: 'Home-Background-Management',
    component: () => import('../components/Home-Background-Management.vue')
  },
  {
    path: '/headerBackgroundManagement',
    name: 'Header-Background-Management',
    component: () => import('../components/Header-Background-Management.vue')
  },
  {
    path: '/car',
    name: 'Car',
    meta: {
      requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    },
    component: () => import('../views/car/Car.vue')
  },
  {
    path: '/iphone',
    name: 'iPhone',
    meta: {
      requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    },
    component: () => import('../views/iPhone')
  },
  {
    path: '/android',
    name: 'Android',
    meta: {
      requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    },
    component: () => import('../views/Android')
  },
  {
    path: '/pad',
    name: 'Pad',
    meta: {
      requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    },
    component: () => import('../views/Pad')
  },
  {
    path: '/car/addCar',
    name: 'AddCar',
    meta: {
      requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    },
    component: () => import('../views/car/Add-Car')
  },
  {
    path: '/car/editCar',
    name: 'EditCar',
    meta: {
      requireAuth: true // 添加该字段，表示进入这个路由是需要登录的
    },
    component: () => import('../views/car/Edit-Car')
  },
]
const router = new VueRouter({
  // mode: 'history',
  routes
})

export default router
